package com.ruoyi.ae.api;

import com.ruoyi.ae.api.domain.AeProductPost;
import com.ruoyi.ae.api.domain.ImageBankParam;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.gather.api.domain.dto.AeAutoProductDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

@FeignClient(contextId = "remoteAeProductService", value = ServiceNameConstants.AE_SERVICE)
public interface RemoteAeProductService {


    @GetMapping("/erp/productGroup/synchronizeProductGroup/{groupId}")
    R<Object> synchronizeProductGroup(@PathVariable("groupId") String groupId);

    @PostMapping("/erp/erpProduct/productOfflineForUpdateTestInnerAuth")
    R<Object> productOfflineForUpdateTestInnerAuth(Map<String, Object> map);

    @GetMapping("/erp/erpProduct/getEUResponsiblePersonFromAeInnerAuth/{categoryId}/{storeId}")
    R<Object> getEUResponsiblePersonFromAeInnerAuth(@PathVariable("categoryId") Long categoryId, @PathVariable("storeId") Long storeId);

    @GetMapping("/erp/erpProduct/queryPromiseTemplateById/{templateId}/{storeId}")
    R<Object> queryPromiseTemplateById(@PathVariable("templateId") String templateId, @PathVariable("storeId") Long storeId);

    @GetMapping("/erp/erpProduct/categoryTreeListInnerAuth/{categoryId}/{sellerId}")
    R<Object> categoryTreeListInnerAuth(@PathVariable("categoryId") Long categoryId, @PathVariable("sellerId") Long sellerId);

    @PostMapping("/erp/erpProduct/uploadImageForSDKTest")
    R<Object> uploadImageForSDKTest(@RequestBody ImageBankParam imageBankParam);

    @PostMapping("/erp/erpProduct/offlineAeProduct")
    R<Object> offlineAeProduct(@RequestBody Map<String, Object> returnMap);

    @PostMapping("/erp/erpProduct/onlineaeproduct")
    R<Object> onlineAeProduct(@RequestBody Map<String, Object> returnMap);

    @GetMapping("/erp/erpProduct/queryAeProductInnerAuth/{productId}/{sellerId}")
    R<Object> queryAeProduct(@PathVariable("productId") Long productId, @PathVariable("sellerId") String sellerId);

    @PostMapping("/erp/erpProduct/getErpProductInfo")
    R<Object> getErpProductInfo(@RequestBody AeProductPost aeProductPost);

    @GetMapping("/erp/erpProduct/findAeProductStatusById/{aeProductId}/{storeId}")
    R<Object> findAeProductStatusById(@PathVariable("aeProductId")Long aeProductId, @PathVariable("storeId")Long storeId);

    @GetMapping("/erp/erpProduct/getFreightTemplateLogisticsCompany/{templateId}/{storeId}")
    R<Object> getFreightTemplateLogisticsCompany(@PathVariable("templateId") Long templateId, @PathVariable("storeId") Long storeId);

    @GetMapping("/erp/erpProduct/getSellerStoreFreightTemplate/{sellerId}")
    R<Object> getSellerStoreFreightTemplate(@PathVariable("sellerId") Long sellerId);

    @PostMapping("/erp/erpProduct/autoPublishToAe")
    R<Object> autoPublishToAe(@RequestBody AeAutoProductDto autoProductDto);


    /**
     * 下架商品
     * @param aeProductId
     * @param storeId
     * @return
     */
    @GetMapping("/erp/erpProduct/productOffline/{aeProductId}/{storeId}")
    R<Object> productOffline(@PathVariable("aeProductId") Long aeProductId, @PathVariable("storeId") Long storeId);

    /**
     * 删除商品
     * @param aeProductId
     * @param storeId
     * @return
     */
    @GetMapping("/erp/erpProduct/deleteProductToAe/{aeProductId}/{storeId}")
    R<Object> deleteProductToAe(@PathVariable("aeProductId") Long aeProductId, @PathVariable("storeId") Long storeId);

}
